﻿using System.Diagnostics;

namespace Orange.Lib.Effective
{
    interface IPhone
    {
        void Call();
    }

    abstract class AppPhone : IPhone
    {
        //In Java abstract class implement a interface can contain no code at all.
        //But in C# abstract class implement a interface can contain abstract method.
        public abstract void Call();
    }

    class AppPhone4 : AppPhone
    {
        //All the method with override is virtual method.
        public override void Call()
        {
            Debug.WriteLine("MyDerived");
        }
    }

    class AppPhone4S : AppPhone4
    {
        //override again 
        // sealed: but the derived class cannot override any more.
        public sealed override void Call()
        {
            base.Call();
        }
    }

    class AppIPhone5 : AppPhone4S
    {
    }
}
